<?php
class Admin_Acl_Access_Delete_Action extends NICED_Action 
{       
	public function execute() 
	{
        $this->forward("admin.index");

		$controller = $this->getController();
		$request    = $controller->getRequest();			
        $id         = $request->loadParam("id", NULL, "posint");
        $act        = $request->loadParam("act", NULL, "safe");

        if (!$id)
        {
            $id = $request->loadArg(0, "id", 0, "posint");
        }

        if (!$id)
        {
            throw new NICED_Exception("please assign id");
        }

		$model      = $controller->getModel('Admin.Acl.Access.Index');

		try
		{
            $model->delete($id);
		}
		catch (Exception $e)
		{
			$controller->handleException($e);
			return self::SUCCESS;
		}

		return self::SUCCESS;
	}

}//end class
